﻿using System.Collections.Generic;
using TrueSync;
using UnityEngine;

namespace HEFramework
{
    public class Statistic : Entity, IAwake
    {
        public enum eType
        {
            Normal,
            Battle,
        }

        public struct StatisticData
        {
            /// <summary>
            /// 触发时间
            /// </summary>
            public long Time { get; set; }

            /// <summary>
            /// 发生坐标
            /// </summary>
            public TSVector Pos { get; set; }

            /// <summary>
            /// 施加者属性ID
            /// </summary>
            public int A_ID { get; set; }

            /// <summary>
            /// 接受者属性ID
            /// </summary>
            public int B_ID { get; set; }

            /// <summary>
            /// 力量类型
            /// </summary>
            public ePowerType PowerType { get; set; }

            /// <summary>
            /// 是否暴击
            /// </summary>
            public bool IsCritical { get; set; }

            /// <summary>
            /// 是否闪避
            /// </summary>
            public bool IsMiss { get; set; }

            /// <summary>
            /// HP变化值
            /// </summary>
            public FP HP { get; set; }

            /// <summary>
            /// MP变化值
            /// </summary>
            public FP MP { get; set; }

            /// <summary>
            /// 是否展示
            /// </summary>
            public bool IsShow { get; set; }

            /// <summary>
            /// 信息
            /// </summary>
            public string Message { get; set; }

            /// <summary>
            /// 类型
            /// </summary>
            public eType Type { get; set; }
        }

        public List<StatisticData> StatisticDatas { get; } = new();
    }
}